package lee.vioson.remotedata.bean

import android.os.Build
import android.os.Parcel
import android.os.Parcelable

/**
 *Author:viosonlee
 *Date:2023/6/15
 *DESCRIPTION:
 */

fun <T : Parcelable> Parcel.readParcelable(clazz: Class<T>): T? {
    return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
        readParcelable(clazz.classLoader, clazz)
    } else {
        readParcelable(clazz.classLoader)
    }
}